Work Request Manager API

(1 review)

How to use the WRM API

Overview

The following information describes how to use the Work Request Manager (WRM) API:

 


Subscribe for notifications

In order to receive notifications about work requests and activities, consumers (Work Requestor and Work Suppliers) must complete a one-time subscription process.

There are two parts to this process:

  1. Submit a subscription request - POST /subscribers with a secret key and a webhook url that is to be used to receive notifications.
  2. Validate the webhook URL endpoint - Provide a GET endpoint at the webhook url to receive a challenge querystring value that must be echoed in the GET response.

Submit a subscription request

POST /subscribers

The WRM API exposes an endpoint (POST /subscribers) to enable consumers to subscribe for outbound notifications from the WRM. The subscribing party uses the client authentication credentials supplied by Chorus for Basic Authentication.

In order to submit a subscription request, the Work Requester or Work Supplier provides Chorus with a secret key and a webhook URL where notifications are sent.

WRM generates an HMAC signature of notification payloads and includes that signature in the request headers of the content distribution request. The X-Hub-Signature header's value is in the form "sha256=". The signature is computed using the HMAC algorithm sha256 with the request body as the data and the secret key as the key.

The secret key is subsequently used to generate the X-Hub-Signature that is included in all notifications outbound from WRM to the subscriber:

[HTTP Header] X-Hub-Signature: sha256=7d3......a23791c5f6

When the subscriber receives the notification message, they use the secret key to decrypt the X-Hub-Signature to verify the request source is the WRM API.

Validate the webhook URL endpoint

GET /[webhook]

The consumer exposes a GET endpoint at the provided webhook URL to receive the challenge. This is an anonymous authentication call, and will uses the encrypted X-Hub-Signature header detailed above.

After the POST /subscribers operation has been successfully called, the internal WRM publish/subscribe subsystem performs a GET operation against the provided webhook URL with a one-time, unique challenge string.

The response to the GET operation must echo the provided challenge string in a json body with an 200 http status code to become verified.

Example

A request is sent from WRM to GET https://consumer_domain/endpoint/?challenge=unique_generated_string&subscriberId=123

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: XXX
Date: Fri, 15 Jan 2021 05:08:21 GMT
Cache-control: private
{
    "challenge": "unique_generated_string"
}

 


Manage a work request end-to-end

The following table describes the end-to-end process for a work request:

StepRoleDescriptionActionTask Status / SubstateActivity Category / State
1Work RequestorCreate the work request task and send to Work SupplierNotify with CreateTaskEventAllocation/SentOpen/Open
2Work SupplierAccept the taskNotify with AcceptTaskEventInProgressOpen/Accepted
3Work SupplierSchedule the activitySchedule the activity in Work Supplier's internal scheduling systemInProgressOpen/Scheduled
4Work SupplierUpdate the activity statusNotify with UpdateTaskActivityStatusEventInProgressOpen/[state]
5Work SupplierProvide details of the allocated field workerNotify with UpdateTaskActivityWorkerEventInProgressOpen/Assigned
6Work SupplierConfirm arrival of worker at siteNotify with UpdateTaskActivityStatusEventInProgressActive/OnSite
7Work SupplierConfirm service givenNotify with UpdateTaskActivityStatusEventInProgressActive/PracticalCompletion
8Work SupplierProvide activity outcomesNotify with UpdateTaskActivityOutcomesEventInProgressActive/[state]
9Work SupplierClose the activityNotify with CloseTaskActivityEventInProgressClosed
10Work RequestorClose the task on completion of all activitiesAutomatic closeClosedClosed

The following diagram shows the state transition of a work request:

resources/Activity%20State%20Transition%20Diagram-6d27082e-d7b7-4d24-bae1-23c6ddd22e62.jpg

 


Posting an event notification

POST /notifications

Use this endpoint to notify the Work Requestor of all updates and changes to a task and its associated activitites.

The following table describes the attributes required for all notification types:

AttributeDetailsType
notificationTypeThe type of notification to be posted, see API Resources > Notifications for a table of available notification types.enum
notificationDateTimeThe date and time the notification was issued.datetime
linked NotificationIdThe ID of the original notification that triggered the notification, e.g. the ID of the event notification from the Work Requestor.string
notificationIdThe notification ID as a GUID.string
subscriberIdYour subscriber ID.string
task.idThe Id of the task generated by WRM.string

Each notification type has different attributes that are required. See details below, or the /notifications method in the Specification.

 


Updating a task

This section describes how to use the WRM API to update a task:

Accept or reject a work request

To accept or reject a work request use the AcceptTaskEvent or the RejectTaskEvent notificationTypes.

Rules:

  • A work request must be accepted before work can start.
  • A work request can only be rejected if work hasn't started.
  • When rejecting a Work Request the rejectReason attribute must be supplied.

The following table describes the additional attributes required for the AcceptTaskEvent or RejectTaskEvent event notifications:

AttributeDetailsType
task.allocation.supplierAcceptedThe Work Supplier accepts or rejects the task.boolean
task.allocation.rejectReasonThe reason code associated with the rejection, mandatory for RejectTaskEvents.enum
task.allocation.rejectNoteAdditional information relating to the rejection, must contain the other task ID for duplicate task rejections.string (max 5000)
Provide or receive additional information

To send additional information use the UpdateTaskAdditionalInfosEvent notificationType.

Rule: The interactionType, information, and createdBy fields are mandatory.

The table below describes the additional attributes available for the UpdateTaskAdditionalInfosEvent event notification. Multiple additional information records on a task can be added or updated:

AttributeDetailsType
task.additionalInfos[].interactionIdThe Id of the interaction to group information exchanges into threads.string
task.additionalInfos[].interactionTypeThe type of interaction.string
task.additionalInfos[].informationInformation relating to the request or response.string (max 5000)
task.additionalInfos[].createdByName of the entity requesting or responding to the request.string
task.additionalInfos[].additionalInfoDetail[].keyName of additional information detail value.string
task.additionalInfos[].additionalInfoDetail[].valueValue of additional information detail value.string
task.additionalInfos[].contactContact details relating to the additional information, e.g. the site contact. See Types > Contact for details on additional attributes for the Contact object.Contact

 

Attach a file to a task

To attach or update a file use the UpdateTaskFileAttachmentsEvent notificationType.

Rules:

  • When updating file attachments on a task, the entire array of file attachments to the task must be provided.
  • The update task event must verify that the party requesting the update is the owner of the files.

The table below describes the additional attributes available for the UpdateTaskFileAttachmentsEvent event notification:

AttributeDetailsType
task.fileAttachments[].fileNameThe name of the file attached to the task.string
task.fileAttachments[].ownerThe owner of the file, i.e. the Work Supplier attaching the file.stirng
task.fileAttachments[].mediaTypeThe type of media attached, e.g. pdf, png, json, etc.enum
task.fileAttachments[].fileSizeThe size of the file attached, in bytes.number
task.fileAttachments[].noteA generic note associated with the file attachment.string (max 5000)
task.fileAttachments[].fileAttachmentUriUnique Resource Identifier for the file attachment.string

 


Updating an activity

This section describes how to use the WRM API to update a task:

For updating one or more activities on a task, the following additional attributes are required. Not all activities on a task are required to be updated in each event notification:

AttributeDetailsType
task.activities[].idThe Id of the activity being updated.string

 

Update a worker contact

To send Chorus the details of a worker contact use the UpdateTaskActivityWorkerEvent notificationType.

Rule: Provide the worker's name either in the name attribute or both the firstName and lastName attributes.

The following table describes the additional attributes required for the UpdateTaskActivityWorkerEvent event notification. Multiple activities on a task can be updated:

Note: See Types > Contact for details on additional attributes for the Contact object.

AttributeDetailsType
task.activities[].worker.nameFull name of the worker allocated to the activity. Alternatively complete the firstName and lastName attributes.string
task.activities[].worker.roleWorkerenum

 

Update a schedule

To send Chorus the details of an updated schedule for an activity use the UpdateTaskActivityScheduleByWorkSupplierEvent notificationType.

Rule: Send this notification after:

  • confirming schedule details for an activity
  • rescheduling an activity
  • cancelling an appointment.

See Managing appointments and updating schedules below.

The following table describes the additional attributes required for the UpdateTaskActivityScheduleByWorkSupplierEvent event notification. Multiple activities on a task can be updated:

AttributeDetailsType
task.activities[].schedule.appointmentRequiredIf the activity requires an appointment.boolean
task.activities[].schedule.appointmentTimeThe date and time for the appointment.datetime
task.activities[].schedule.nextActionOwnerThe owner of the next action when the activity has been rescheduled.string
task.activities[].schedule.noteAdditional details about the schedule update, e.g. supporting information for reschedule.string (max 5000)
task.activities[].schedule.rescheduleReasonThe reason for the rescheduling.enum
task.activities[].schedule.scheduledStartThe scheduled start time for an activity.datetime
task.activities[].schedule.scheduledEndThe scheduled end time for an activity.datetime
task.activities[].schedule.workDivisionThe work division allocated to this activity by Chorus, if work type is REMO.string

 

Provide a status update

To send Chorus a status update use the UpdateTaskActivityStatusEvent notificationType. See Manage a work request end-to-end above for the state types.

Rule: The geoTag attribute is mandatory when the category is Active and the state is OnSite.

The following table describes the additional attributes required for the UpdateTaskActivityStatusEvent event notification. Multiple activities on a task can be updated:

AttributeDetailsType
task.activities[].status.categoryThe overall lifecycle state of the activity, either Open or Active.enum
task.activities[].status.stateThe state of the activity in relation to its assigned category.enum
task.activities[].status.noteAdditional information in relation to the activity status.string (max 5000)
task.activities[].status.workSupplierDateThe timestamp of the status change from the Work Supplier's internal system.DateTime
task.activities[].status.geoTagThe location of the work taking place when category is Active and state is OnSite.geoTag

 

Attach a file to an activity

To attach or update a file use the UpdateTaskActivityFileAttachmentsEvent notificationType.

Rules:

  • When updating file attachments on activities, the entire array of file attachments to the activity must be provided.
  • The update task event must verify that the party requesting the update is the owner of the files.

The table below describes the additional attributes available for the UpdateTaskActivityFileAttachmentsEvent event notification. Multiple activities on a task can be updated:

AttributeDetailsType
task.activities[].fileAttachments[].fileNameThe name of the file attached to the activity.string
task.activities[].fileAttachments[].ownerThe owner of the file, i.e. Work Supplier attaching the file.stirng
task.activities[].fileAttachments[].mediaTypeThe type of media attached, e.g. pdf, png, json, etc.enum
task.activities[].fileAttachments[].fileSizeThe size of the file attached, in bytes.number
task.activities[].fileAttachments[].noteA generic note associated with the file attachment.string (max 5000)
task.activities[].fileAttachments[].fileAttachmentUriUnique Resource Identifier for the file attachment.string

 

Provide outcomes

To send Outcomes use the UpdateTaskActivityOutcomesEvent notificationType.

The table below describes the additional attributes available for the UpdateTaskActivityOutcomesEvent event notification. Multiple activities on a task can be updated:

AttributeDetailsType
task.activities[].outcomes[].typeThe type of outcome.string
task.activities[].outcomes[].keyName of outcome value.string
task.activities[].outcomes[].valueThe outcome associated with the key.string

 

Close an activity

To close an activity, use the CloseTaskActivityEvent notificationType.

When all activities on a task are closed (including verification activities), the task is automatically closed.

This table below describes the additional attributes avaiable for the CloseTaskActivityEvent event notification. Multiple activities on a task can be updated:

AttributeDetailsType
task.activities[].status.categoryClosedenum
task.activities[].status.stateCancelled | Completed | Incompleteenum
task.activities[].status.noteAdditional information in relation to the activity status.string (max 5000)
task.activities[].status.workSupplierDateThe timestamp of the status change from the Work Supplier's internal system.DateTime

 


Managing appointments and updating schedules

This section describes how to manage appointments:

These operations are independent of the main work request management workflow, but the UpdateTaskActivityScheduleByWorkSupplier event notification must be posted to provide updates back to the work requestor.

When the Work Supplier creates a task or adds an activity to a task, the following information is provided in the activity schedule (not all attributes may be present):

AttributeDetailsType
scheduleIdThe schedule identifier - provided if an appointment is required and the appointment time is supplied.string
siteVisitTypeThe type of visit or appointment, e.g. Scope, Install, ReplaceONT, etc.enum
workDivisionWork division allocated to this activity by the Work Requestor, if the work type is REMOstring
areaSiteArea site if the work type is REMI, REMS, or PRM.string
classOfWorkClass of work if the work type is REMI, REMS, or PRM.string
equipmentTypeEquipment type if the work type is REMI, REMS, or PRM.string
allowAppointmentBroughtForwardAppointment can be brought forward.boolean
appointmentBookingIdAppointment booking Id - must be used if Work Supplier reschedules or cancels appointment.string
appointmentRequiredActivity requires an appointment.boolean
appointmentTimeDate and time for the appointmentdatetime
chorusReschAllowedAppointment can be rescheduled by the Work Requestorboolean
earliestStartThe earliest date and time the activity can be started - must be supplied if latestEnd is not provided.datetime
latestEndThe latest date and time the acitivty must be completed - must be supplied if earliestStart is not provided.datetime

The CreateTaskNotify and AddActivityNotify event notifications also provide an externalScheduleReference from the Work Supplier's internal system.

 

Confirm an appointment
POST /appointments/{bookingId}/confirm

Use this endpoint to confirm an existing reserved appointment.

The table below describes the attributes required to confirm a reserved appointment for all task types:

AttributeDetailsType
bookingIdThe activity.schedule.appointmentBookingId from the reserved appointment.string
scheduleIdThe activity.schedule.Id from the reserved appointment.string
areaTypeThe locale type, either Urban or Rural.enum
bookingTypeThe appointment booking type, either BY or BETWEENenum
workTypeWork type as provided by the Work Requestor, either FibreConnect, REMI, REMO, REMS, or PRM.enum
location.locationIdThe location Id relating to the site.string
location.locationIdTypeThe type of locaiton, either TLC or CONNECTIONPOINTenum

The table below describes the additional attributes required to confirm a reserved appointment for a Fulfil task:

AttributeDetailsType
campaignIdThe selected campaign.string
customerSiteVisitRequiredIf a customer site visit is required for this appointment, either YES or NO.enum
appointmentTypeAPPOINTMENTstring
dayOfWeekWhen appointment can be booked, either Business days or Extended hoursenum

The table below describes the additional attributes required to confirm a reserved appointment for an Assure task:

AttributeDetailsType
productIdThe product Id provided by the Work Requestor.string
reservationCategoryPriority of appointment date and time, either Preferred or Alternative.enum
reservationTypeType of reservation required, either FIRST_AVAILABLE_TIMESLOT or DEFAULT for campaigns.enum
requestedStartDateTimeAppointment start date and time provided by the Work Requestor.datetime
requestedEndDateTimeAppointment end date and time provided by the Work Requestor.datetime
timeslotTypeType of timeslot, either DELIVERY, APPOINTMENT, or APPOINTMENT TIME SLOT.enum

After confirming the appointment, post a notification using the UpdateTaskActivityScheduleByWorkSupplierEvent event notification to advise Chorus of the confirmed appointment. See Update a schedule above.

 

Determine available timeslots
GET /appointments/{bookingId}/timeslots

Use this endpoint to get a list of available timeslots for an appointment for rescheduling.

The following table describes the query parameters required:

ParameterDetails
areaTypeThe locale type, either Urban or Rural.
scheduleIdThe activity.schedule.Id from the reserved appointment.
workTypeWork type as provided by the Work Requestor, either FibreConnect, REMI, REMO, REMS, or PRM - optional for Fulfil tasks.
locationIdThe location Id relating to the site.
locationIdTypeThe type of locaiton, either TLC or CONNECTIONPOINT

 

Reschedule an appointment
PUT /appointments/{bookingId}

Use this endpoint to:

  • request a change of date and time for an existing confirmed appointment
  • reschedule a previously cancelled appointment.

Determine the available timeslots to reschedule the appointment using GET /appointments/{bookingId}/timeslots, see Determine available timeslots above. Work Requestors are responsible for maintaining their availability through the Service Company Alliance (SCA) system.

Rules:

  • Work Suppliers are responsible for supplying the correct booking id and appointment details to the WRM, using the UpdateTaskActivityScheduleByWorkSupplierEvent notification.
  • For Assure tasks, either the earliest start or latest end date and times are specified - this determines the schedule type.

Note: If all timeslots for the schedule are used, the PUT /appointments/{bookingId} operation acts as an override and allows negative units, i.e. the available units becomes -1.

The table below describes the attributes required to reschedule an appointment:

AttributeDetailsType
bookingIdThe activity.schedule.appointmentBookingId from the original appointment.string
releaseOriginalSlotThe number of units to be added or removed.number
requestedEndDateTimeThe appointment end date and time.datetime
requestedStartDateTimeThe appointment start date and time.datetime
rescheduleTypeThe type of schedule - for Fibre Fulfil: APPOINTMENT, Assure: BETWEEN if earliest start is set, BY if latest end is set.string
scheduleCodeThe externalScheduleReference from the original create task or add activity notification.string

After rescheduling the appointment, post a notification using the UpdateTaskActivityScheduleByWorkSupplierEvent event notification to advise Chorus of the updated timeslot. See Update a schedule above.

 

Cancel an Appointment
DELETE /appointments/{bookingId}

Use this endpoint to cancel an appointment. This removes the appointment but allows it to be rescheduled later.

Rules:

  • Work Suppliers are responsible for supplying the correct booking id to the WRM.
  • Work Suppliers must retain the original booking ID to use if they want to reschedule a cancelled appointment.
  • For Assure tasks, either the earliest start or latest end date and times are specified - this determines the schedule type.

Note: There are no attributes required (except for the bookingId) and no payload is returned.

After cancelling the appointment, post a notification using the UpdateTaskActivityScheduleByWorkSupplierEvent event notification to advise Chorus of the cancelled appointment. See Update a schedule above.


Reviews